<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>幸运数字</title>
    </head>
    <body>
        <script>
            let a=0,b=0,c=0,cnt=0;
            let str="";
            for(let i = 1;i<=20;++i){
                a = Math.floor(Math.random()*9+1);
                b = Math.floor(Math.random()*9+1);
                c = Math.floor(Math.random()*9+1);
                str = a+" "+b+" "+c;
                document.write(str);
                document.write('<br/>');
                if(a===6||b===6||c===6) ++cnt;
            }
            document.write("成功次数："+cnt+",成功率："+cnt/20);
        </script>
    </body>
</html>